package top.yxf.spring.support;

import top.yxf.spring.config.SingletonBeanRegister;

import java.util.HashMap;
import java.util.Map;

/**
 * @author xs.wu
 */
public class DefaultSingletonBeanRegistry implements SingletonBeanRegister {

    private final Map<String, Object> singletonMap = new HashMap<>();

    @Override
    public Object getSingleton(String beanName) {
        return singletonMap.get(beanName);
    }

    public void registerSingleton(String beanName, Object singletonObject) {
        singletonMap.put(beanName, singletonObject);
    }
}
